package com.orhon.smartcampus.modules.baseinfo.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

@Setter
@Getter
@EqualsAndHashCode
@Entity
@Table(name = "baseinfo_schoolcalendar_week", schema = "smartcloud", catalog = "")
public class SchoolcalendarWeek {
    @Id
    @GeneratedValue
    @Column(name = "id", nullable = false)
    private Long id;
    @Column(name = "month", nullable = false, length = 120)
    private String month;
    @Column(name = "across_month", nullable = false, length = 120)
    private String acrossMonth;
    @Column(name = "semester_id", nullable = true)
    private Long semesterId;
    @Column(name = "year_code", nullable = true, length = 32)
    private String yearCode;
    @Column(name = "week_sort", nullable = true)
    private Integer weekSort;
    @Column(name = "created_at", nullable = true)
    private Date createdAt;
    @Column(name = "updated_at", nullable = true)
    private Date updatedAt;
    
    @OneToMany(fetch = FetchType.LAZY)
    @JoinColumn(name = "week_id", referencedColumnName = "id")
    @NotFound(action=NotFoundAction.IGNORE)
	private List<SchoolcalendarDay> schoolcalendarDays;



}
